package org.yinweichen.llm_dataset_backend.repository;

import org.yinweichen.llm_dataset_backend.entity.StandardAnswer;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.yinweichen.llm_dataset_backend.entity.StandardAnswerId;

import java.util.List;

@Repository
public interface StandardAnswerRepository extends JpaRepository<StandardAnswer, StandardAnswerId> {
    @Modifying
    @Query("UPDATE StandardAnswer a SET a.answer = :answer WHERE a.questionId = :questionId AND a.version = :version")
    int updateAnswer(@Param("questionId") Long questionId, @Param("version") String version, @Param("answer") String answer);

}
